Skip to content

Backport RHEL 8 and 9 RPM builds to 0.4 release stream - #570

Open
holdeg wants to merge 1 commit into
Mirantis:release/0.4from
holdeg:holdeg/rhel-builds-for-0.4.x
Open

Backport RHEL 8 and 9 RPM builds to 0.4 release stream#570
holdeg wants to merge 1 commit into
Mirantis:release/0.4from
holdeg:holdeg/rhel-builds-for-0.4.x

Conversation

@holdeg

@holdeg holdeg commented Jul 27, 2026

Copy link
Copy Markdown

We're interested in taking the 0.4.x release stream of cri-dockerd and would like RHEL 8 and 9 RPM builds from the project - #524 achieved this on master, #550 backported it to 0.3.x, and now we'd like it in 0.4.x too. This PR simply cherry-picks those changes (edc762a) into the release/0.4 branch so that RPMs for these distributions are available for 0.4.x builds.

Please see the original PR #524 for details on implementation.

Comment on lines 1 to 26
ARG GO_IMAGE
ARG DISTRO=aepifanov/centos7.vault
ARG SUITE=latest
ARG DISTRO=almalinux
ARG SUITE=9
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ARG DISTRO
ARG SUITE
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
ENV GOPROXY=direct
ENV GOPATH=/go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS seccomp selinux
ENV RUNC_BUILDTAGS seccomp selinux
ARG DISTRO
ARG SUITE
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
RUN yum install -y rpm-build rpmlint yum-utils
RUN dnf config-manager --set-enabled powertools
# Enable CodeReady Builder repository to get device-mapper-devel and glibc-static.
RUN dnf config-manager --set-enabled crb
COPY SPECS /root/rpmbuild/SPECS
# Overwrite repo that was failing on aarch64
RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec
COPY --from=golang /usr/local/go /usr/local/go
COPY --from=golang /usr/local/go /usr/local/go/
WORKDIR /root/rpmbuild
ENTRYPOINT ["/bin/rpmbuild"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker container runs as default root user - medium severity
By default, containers are run with root privileges and also run as the root user inside the container. Running the app as root gives a hacker who was able to hack the application instant root access to the Docker host, which could help them to escalate a hack.

Show fix

Remediation: Add 'USER username' to the end of your file.

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Comment on lines 1 to 26
ARG GO_IMAGE
ARG DISTRO=centos
ARG DISTRO=almalinux
ARG SUITE=8
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ARG DISTRO
ARG SUITE
ENV DISTRO ${DISTRO}
ENV SUITE ${SUITE}
ENV GOPROXY=direct
ENV GOPATH=/go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS seccomp selinux
ENV RUNC_BUILDTAGS seccomp selinux
ARG DISTRO
ARG SUITE
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
RUN yum install -y rpm-build rpmlint yum-utils
# Enable PowerTools repository to get device-mapper-devel and glibc-static.
RUN dnf config-manager --set-enabled powertools
COPY SPECS /root/rpmbuild/SPECS
# Overwrite repo that was failing on aarch64
RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec
COPY --from=golang /usr/local/go /usr/local/go
COPY --from=golang /usr/local/go /usr/local/go/
WORKDIR /root/rpmbuild
ENTRYPOINT ["/bin/rpmbuild"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker container runs as default root user - medium severity
By default, containers are run with root privileges and also run as the root user inside the container. Running the app as root gives a hacker who was able to hack the application instant root access to the Docker host, which could help them to escalate a hack.

Show fix

Remediation: Add 'USER username' to the end of your file.

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants